<template>
  <div>
    <van-nav-bar class="top-nav-bar" title="个人中心">
      <template #left>
        <i class="iconfont icon-jingzi"></i>
      </template>
      <template #right>
        <van-button
          class="download"
          color="#FB7299"
          text="下载App"
        ></van-button>
      </template>
    </van-nav-bar>
    <user-info :userInfoList="userInfoList"></user-info>
  </div>
</template>

<script>
import { getUserInfoAPI } from "@/network/api";

import UserInfo from "./personal/UserInfo";
export default {
  name: "Personal",
  data() {
    return {
      userInfoList: {},
    };
  },
  components: {
    UserInfo,
  },
  mounted() {
    getUserInfoAPI(
      localStorage.getItem("id"),
      localStorage.getItem("token")
    ).then((res) => {
      this.userInfoList = res.data[0];
    });
  },
};
</script>

<style scoped  lang="less" >
.top-nav-bar {
  .download {
    width: 72px;
    height: 24px;
    border-radius: 5px;
    padding: 0;
  }
}
.avatar {
  width: 200px;
  height: 200px;
}
</style>